import {createRouter, createWebHistory} from "vue-router";
import Login from "@/views/Login.vue";
import Aside from "@/components/Aside.vue";
import Home from "@/views/Home.vue";
import Page1 from "@/views/Page1.vue";
import Page2 from "@/views/Page2.vue";



const routes = [
    {
      path: '/',
      redirect: '/login'
    },
    {
        path: '/login',
        component: Login
    },
    {
        path: '/aside',
        component: Aside
    },
    {
        path: '/home',
        component: Home,
        children: [
            {
                path: '/page1',
                component: Page1
            },
            {
                path: '/page2',
                component: Page2
            }
        ]
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router